#include "Integers.h"
namespace SymCe{
	Sign other(Sign sign){
		if (sign == NEGATIVE){
			return POSITIVE;
		}else{
			return NEGATIVE;
		}
	}
	
	Integer gcd(Integer a, Integer b){
		//Finds greatest common divisor.
		Integer c;
		if(a > b){
			//swap(a, b)
			c=b;
			b=a;
			a=c;
		}
		//b>a
		while(a!=0){
			b=b%a;
			c=b;
			b=a;
			a=c;
		}
		return b;
	}
	
	Integer lcm(Integer a, Integer b){
		//Finds least common multiple
		Integer c = gcd(a, b);
		a = a/c;
		return a*b;
	}		
}
